<template>
  <div>
      <span style="font-size:14px;color:#fff">时间选择：</span><el-select v-model="value" placeholder="请选择时间">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value">
      </el-option>
    </el-select>
    <el-button style="margin-left: 10px" size="mini" type="primary" @click="searchData">查询</el-button>

    <one :oneNums="oneNums" ref = 'oneData'></one>
    <two :twoNums="twoNums" ref = 'twoData'></two>
  </div>
</template>
 
<script>
import one from "./components/dataEcharts1.vue";
import two from "./components/dataEcharts2.vue";

import { Devicehistory } from "../../request/api";


export default {
 
  data() {
    return {
      oneNums:7,
      twoNums:7,
      options: [{
          value: '7',
          label: '过去一周'
        }, {
          value: '15',
          label: '过去十五天'
        }, {
          value: '30',
          label: '过去一个月'
        }],
        value: ''
      }
    
  },
  components:{
    one,
    two
   },
  methods: {
    searchData(){
      let a = this.value
      this.$refs.oneData.getData(a)
      this.$refs.twoData.getData(a)
    }
  },
  //调用
  mounted() {
    
  }
};
</script>
 
<style scoped>

</style>